{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "047ebcfd-eefe-40d3-b2d4-99320fb41632",
   "metadata": {},
   "outputs": [],
   "source": [
    "import polars as pl"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "a597a416-2f2f-46f3-b286-08dbbdf0233a",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pl.read_csv(\"stock_trades/202207-湘财.xls\", encoding=\"gb18030\", separator=\"\\t\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "1cdd054b-6364-4254-8f6f-ae905f41618a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "polars.dataframe.frame.DataFrame"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "afc436a3-5fed-4ec4-9de5-1cd31b114d3b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(17, 16)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "0f102623-ddc7-4268-9d62-ce8f3d8be038",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "17"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.height"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "78674a0a-7e10-408c-a780-7f416292002b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "16"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.width"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "0a740330-77c6-411e-ab8e-679601f16922",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.is_empty()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "9893b317-52e5-473c-bb45-966099badce7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Schema([('发生日期', Int64),\n",
       "        ('证券代码', String),\n",
       "        ('证券名称', String),\n",
       "        ('买卖标志', String),\n",
       "        ('业务名称', String),\n",
       "        ('成交时间', String),\n",
       "        ('成交数量', String),\n",
       "        ('成交价格', Float64),\n",
       "        ('成交金额', Float64),\n",
       "        ('发生金额', Float64),\n",
       "        ('手续费', String),\n",
       "        ('印花税', String),\n",
       "        ('过户费', String),\n",
       "        ('其他费', String),\n",
       "        ('备注', String),\n",
       "        ('币种', String)])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.schema"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "ff80042c-ebab-47e3-99d6-a33143c52929",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['发生日期',\n",
       " '证券代码',\n",
       " '证券名称',\n",
       " '买卖标志',\n",
       " '业务名称',\n",
       " '成交时间',\n",
       " '成交数量',\n",
       " '成交价格',\n",
       " '成交金额',\n",
       " '发生金额',\n",
       " '手续费',\n",
       " '印花税',\n",
       " '过户费',\n",
       " '其他费',\n",
       " '备注',\n",
       " '币种']"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "be328b56-c7df-48e2-8cdc-5bf88e600972",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "isinstance(df.schema, dict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "78b97424-af46-46f2-837e-3ab1d03eab38",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(df.schema).__base__.__base__"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "5c4aaf7f-cd81-4d97-8af0-0626fffdb37f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "String"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.schema[\"手续费\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "94bd6ac4-d87d-44e4-bfff-40596d599d04",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[Int64,\n",
       " String,\n",
       " String,\n",
       " String,\n",
       " String,\n",
       " String,\n",
       " String,\n",
       " Float64,\n",
       " Float64,\n",
       " Float64,\n",
       " String,\n",
       " String,\n",
       " String,\n",
       " String,\n",
       " String,\n",
       " String]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.dtypes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "23a03444-b152-4e5c-ba3f-5a325de98517",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(df.schema.keys()) == df.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "43f1ae86-776d-4da9-be24-216547f31f23",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(df.schema.values()) == df.dtypes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "d79925bb-478b-4121-902d-9c637ae67574",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (2, 16)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>币种</th></tr><tr><td>i64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>20220718</td><td>&quot;600408&quot;</td><td>&quot;安泰集团&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:44:52&quot;</td><td>&quot;47000.00&quot;</td><td>3.19</td><td>149930.0</td><td>-149955.5</td><td>&quot;23.99&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;1.51&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220718</td><td>&quot;600648&quot;</td><td>&quot;外高桥&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:44:31&quot;</td><td>&quot;11900.00&quot;</td><td>12.6066</td><td>150019.0</td><td>-150044.49</td><td>&quot;24.00&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;1.49&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;人民币&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (2, 16)\n",
       "┌─────────┬─────────┬─────────┬────────┬───┬────────┬────────┬────────┬────────┐\n",
       "│ 发生日  ┆ 证券代  ┆ 证券名  ┆ 买卖标 ┆ … ┆ 过户费 ┆ 其他费 ┆ 备注   ┆ 币种   │\n",
       "│ 期      ┆ 码      ┆ 称      ┆ 志     ┆   ┆ ---    ┆ ---    ┆ ---    ┆ ---    │\n",
       "│ ---     ┆ ---     ┆ ---     ┆ ---    ┆   ┆ str    ┆ str    ┆ str    ┆ str    │\n",
       "│ i64     ┆ str     ┆ str     ┆ str    ┆   ┆        ┆        ┆        ┆        │\n",
       "╞═════════╪═════════╪═════════╪════════╪═══╪════════╪════════╪════════╪════════╡\n",
       "│ 2022071 ┆ 600408  ┆ 安泰集  ┆ 买入   ┆ … ┆ 1.51   ┆ =\"0.00 ┆ 证券买 ┆ 人民币 │\n",
       "│ 8       ┆         ┆ 团      ┆        ┆   ┆        ┆ \"      ┆ 入     ┆        │\n",
       "│ 2022071 ┆ 600648  ┆ 外高桥  ┆ 买入   ┆ … ┆ 1.49   ┆ =\"0.00 ┆ 证券买 ┆ 人民币 │\n",
       "│ 8       ┆         ┆         ┆        ┆   ┆        ┆ \"      ┆ 入     ┆        │\n",
       "└─────────┴─────────┴─────────┴────────┴───┴────────┴────────┴────────┴────────┘"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[3:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "083129be-616d-46c5-adfd-f4aa7e5e4f68",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (2, 5)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th></tr><tr><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td></tr></thead><tbody><tr><td>&quot;09:44:52&quot;</td><td>&quot;47000.00&quot;</td><td>3.19</td><td>149930.0</td><td>-149955.5</td></tr><tr><td>&quot;09:44:31&quot;</td><td>&quot;11900.00&quot;</td><td>12.6066</td><td>150019.0</td><td>-150044.49</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (2, 5)\n",
       "┌──────────┬──────────┬──────────┬──────────┬────────────┐\n",
       "│ 成交时间 ┆ 成交数量 ┆ 成交价格 ┆ 成交金额 ┆ 发生金额   │\n",
       "│ ---      ┆ ---      ┆ ---      ┆ ---      ┆ ---        │\n",
       "│ str      ┆ str      ┆ f64      ┆ f64      ┆ f64        │\n",
       "╞══════════╪══════════╪══════════╪══════════╪════════════╡\n",
       "│ 09:44:52 ┆ 47000.00 ┆ 3.19     ┆ 149930.0 ┆ -149955.5  │\n",
       "│ 09:44:31 ┆ 11900.00 ┆ 12.6066  ┆ 150019.0 ┆ -150044.49 │\n",
       "└──────────┴──────────┴──────────┴──────────┴────────────┘"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[3:5, 5:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "912e9a02-238c-4f6e-b10e-8431d2f78849",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (17, 2)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>证券名称</th><th>成交金额</th></tr><tr><td>str</td><td>f64</td></tr></thead><tbody><tr><td>&quot;赣粤高速&quot;</td><td>4884.0</td></tr><tr><td>&quot;GC007&quot;</td><td>58000.0</td></tr><tr><td>&quot;嘉事堂&quot;</td><td>137344.0</td></tr><tr><td>&quot;安泰集团&quot;</td><td>149930.0</td></tr><tr><td>&quot;外高桥&quot;</td><td>150019.0</td></tr><tr><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;GC007&quot;</td><td>58000.0</td></tr><tr><td>&quot;金隅集团&quot;</td><td>139860.0</td></tr><tr><td>&quot;广日股份&quot;</td><td>139956.0</td></tr><tr><td>&quot;渝农商行&quot;</td><td>139795.0</td></tr><tr><td>&quot;GC007&quot;</td><td>758000.0</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (17, 2)\n",
       "┌──────────┬──────────┐\n",
       "│ 证券名称 ┆ 成交金额 │\n",
       "│ ---      ┆ ---      │\n",
       "│ str      ┆ f64      │\n",
       "╞══════════╪══════════╡\n",
       "│ 赣粤高速 ┆ 4884.0   │\n",
       "│ GC007    ┆ 58000.0  │\n",
       "│ 嘉事堂   ┆ 137344.0 │\n",
       "│ 安泰集团 ┆ 149930.0 │\n",
       "│ 外高桥   ┆ 150019.0 │\n",
       "│ …        ┆ …        │\n",
       "│ GC007    ┆ 58000.0  │\n",
       "│ 金隅集团 ┆ 139860.0 │\n",
       "│ 广日股份 ┆ 139956.0 │\n",
       "│ 渝农商行 ┆ 139795.0 │\n",
       "│ GC007    ┆ 758000.0 │\n",
       "└──────────┴──────────┘"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[:, [\"证券名称\", \"成交金额\"]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "b6fa8baf-5015-4b6f-86bb-63543a03817f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (7, 7)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th></tr><tr><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td></tr></thead><tbody><tr><td>&quot;赣粤高速&quot;</td><td>&quot;卖出&quot;</td><td>&quot;股息入账&quot;</td><td>&quot;16:00:00&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>3.6</td><td>4884.0</td></tr><tr><td>&quot;GC007&quot;</td><td>&quot;卖出&quot;</td><td>&quot;拆出质押购回&quot;</td><td>&quot;19:03:27&quot;</td><td>&quot;-580.00&quot;</td><td>1.675</td><td>58000.0</td></tr><tr><td>&quot;嘉事堂&quot;</td><td>&quot;卖出&quot;</td><td>&quot;证券卖出&quot;</td><td>&quot;09:38:10&quot;</td><td>&quot;-10400.00&quot;</td><td>13.2062</td><td>137344.0</td></tr><tr><td>&quot;安泰集团&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:44:52&quot;</td><td>&quot;47000.00&quot;</td><td>3.19</td><td>149930.0</td></tr><tr><td>&quot;外高桥&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:44:31&quot;</td><td>&quot;11900.00&quot;</td><td>12.6066</td><td>150019.0</td></tr><tr><td>&quot;赣粤高速&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:43:38&quot;</td><td>&quot;40700.00&quot;</td><td>3.69</td><td>150183.0</td></tr><tr><td>&quot;华夏银行&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:42:51&quot;</td><td>&quot;30000.00&quot;</td><td>5.07</td><td>152100.0</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (7, 7)\n",
       "┌──────────┬──────────┬───────────┬──────────┬───────────┬──────────┬──────────┐\n",
       "│ 证券名称 ┆ 买卖标志 ┆ 业务名称  ┆ 成交时间 ┆ 成交数量  ┆ 成交价格 ┆ 成交金额 │\n",
       "│ ---      ┆ ---      ┆ ---       ┆ ---      ┆ ---       ┆ ---      ┆ ---      │\n",
       "│ str      ┆ str      ┆ str       ┆ str      ┆ str       ┆ f64      ┆ f64      │\n",
       "╞══════════╪══════════╪═══════════╪══════════╪═══════════╪══════════╪══════════╡\n",
       "│ 赣粤高速 ┆ 卖出     ┆ 股息入账  ┆ 16:00:00 ┆ =\"0.00\"   ┆ 3.6      ┆ 4884.0   │\n",
       "│ GC007    ┆ 卖出     ┆ 拆出质押  ┆ 19:03:27 ┆ -580.00   ┆ 1.675    ┆ 58000.0  │\n",
       "│          ┆          ┆ 购回      ┆          ┆           ┆          ┆          │\n",
       "│ 嘉事堂   ┆ 卖出     ┆ 证券卖出  ┆ 09:38:10 ┆ -10400.00 ┆ 13.2062  ┆ 137344.0 │\n",
       "│ 安泰集团 ┆ 买入     ┆ 证券买入  ┆ 09:44:52 ┆ 47000.00  ┆ 3.19     ┆ 149930.0 │\n",
       "│ 外高桥   ┆ 买入     ┆ 证券买入  ┆ 09:44:31 ┆ 11900.00  ┆ 12.6066  ┆ 150019.0 │\n",
       "│ 赣粤高速 ┆ 买入     ┆ 证券买入  ┆ 09:43:38 ┆ 40700.00  ┆ 3.69     ┆ 150183.0 │\n",
       "│ 华夏银行 ┆ 买入     ┆ 证券买入  ┆ 09:42:51 ┆ 30000.00  ┆ 5.07     ┆ 152100.0 │\n",
       "└──────────┴──────────┴───────────┴──────────┴───────────┴──────────┴──────────┘"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[:7, \"证券名称\":\"成交金额\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "9b644732-0e5e-42d8-ab94-7c8b704bac6d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (3, 7)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th></tr><tr><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td></tr></thead><tbody><tr><td>&quot;赣粤高速&quot;</td><td>&quot;卖出&quot;</td><td>&quot;股息入账&quot;</td><td>&quot;16:00:00&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>3.6</td><td>4884.0</td></tr><tr><td>&quot;外高桥&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:44:31&quot;</td><td>&quot;11900.00&quot;</td><td>12.6066</td><td>150019.0</td></tr><tr><td>&quot;渝农商行&quot;</td><td>&quot;卖出&quot;</td><td>&quot;证券卖出&quot;</td><td>&quot;09:38:30&quot;</td><td>&quot;-38300.00&quot;</td><td>3.58</td><td>137114.0</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (3, 7)\n",
       "┌──────────┬──────────┬──────────┬──────────┬───────────┬──────────┬──────────┐\n",
       "│ 证券名称 ┆ 买卖标志 ┆ 业务名称 ┆ 成交时间 ┆ 成交数量  ┆ 成交价格 ┆ 成交金额 │\n",
       "│ ---      ┆ ---      ┆ ---      ┆ ---      ┆ ---       ┆ ---      ┆ ---      │\n",
       "│ str      ┆ str      ┆ str      ┆ str      ┆ str       ┆ f64      ┆ f64      │\n",
       "╞══════════╪══════════╪══════════╪══════════╪═══════════╪══════════╪══════════╡\n",
       "│ 赣粤高速 ┆ 卖出     ┆ 股息入账 ┆ 16:00:00 ┆ =\"0.00\"   ┆ 3.6      ┆ 4884.0   │\n",
       "│ 外高桥   ┆ 买入     ┆ 证券买入 ┆ 09:44:31 ┆ 11900.00  ┆ 12.6066  ┆ 150019.0 │\n",
       "│ 渝农商行 ┆ 卖出     ┆ 证券卖出 ┆ 09:38:30 ┆ -38300.00 ┆ 3.58     ┆ 137114.0 │\n",
       "└──────────┴──────────┴──────────┴──────────┴───────────┴──────────┴──────────┘"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[[0, 4, 9], \"证券名称\":\"成交金额\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "d8b4577f-f9dd-4df0-8ec9-b67af5c7d504",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(20220721,\n",
       " '600269',\n",
       " '赣粤高速',\n",
       " '卖出',\n",
       " '股息入账',\n",
       " '16:00:00',\n",
       " '=\"0.00\"',\n",
       " 3.6,\n",
       " 4884.0,\n",
       " 4884.0,\n",
       " '=\"0.00\"',\n",
       " '=\"0.00\"',\n",
       " '=\"0.00\"',\n",
       " '=\"0.00\"',\n",
       " '股息入账:赣粤高速600269; 权益股数:40700;',\n",
       " '人民币')"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.row(0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "1d0b6c03-081d-496a-a5b3-6c0f82bf5d0e",
   "metadata": {},
   "outputs": [],
   "source": [
    "r = df.rows()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "7cee316c-a61d-4288-98f3-050399f01352",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "list"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(r)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "b01e6b3e-0caf-4612-a96c-038ef30e6369",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tuple"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(r[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "79aa1314-d219-4a53-ae42-1b0bcb093ac5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "17"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(r)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "62ff8bb3-b845-4164-91cb-5d28f504d641",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "16"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(r[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "4707a03a-8ca2-4007-a155-33616a5b1426",
   "metadata": {},
   "outputs": [],
   "source": [
    "s = df.get_column(\"成交金额\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "a9f3d762-3014-4777-a1fe-14184b1cdb3f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "polars.series.series.Series"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(s)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "36b17fdf-b56f-45d0-9f5d-2bff7e39c3ed",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (17,)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>证券名称</th></tr><tr><td>str</td></tr></thead><tbody><tr><td>&quot;赣粤高速&quot;</td></tr><tr><td>&quot;GC007&quot;</td></tr><tr><td>&quot;嘉事堂&quot;</td></tr><tr><td>&quot;安泰集团&quot;</td></tr><tr><td>&quot;外高桥&quot;</td></tr><tr><td>&hellip;</td></tr><tr><td>&quot;GC007&quot;</td></tr><tr><td>&quot;金隅集团&quot;</td></tr><tr><td>&quot;广日股份&quot;</td></tr><tr><td>&quot;渝农商行&quot;</td></tr><tr><td>&quot;GC007&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (17,)\n",
       "Series: '证券名称' [str]\n",
       "[\n",
       "\t\"赣粤高速\"\n",
       "\t\"GC007\"\n",
       "\t\"嘉事堂\"\n",
       "\t\"安泰集团\"\n",
       "\t\"外高桥\"\n",
       "\t…\n",
       "\t\"GC007\"\n",
       "\t\"金隅集团\"\n",
       "\t\"广日股份\"\n",
       "\t\"渝农商行\"\n",
       "\t\"GC007\"\n",
       "]"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.to_series(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "e6e99cb1-fa0a-43a7-a1bb-1affcba85f05",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Rows: 17\n",
      "Columns: 16\n",
      "$ 发生日期 <i64> 20220721, 20220718, 20220718, 20220718, 20220718, 20220718, 20220718, 20220718, 20220718, 20220718\n",
      "$ 证券代码 <str> '600269', '204007', '=\"002462\"', '600408', '600648', '600269', '600015', '601992', '600894', '601077'\n",
      "$ 证券名称 <str> '赣粤高速', 'GC007', '嘉事堂', '安泰集团', '外高桥', '赣粤高速', '华夏银行', '金隅集团', '广日股份', '渝农商行'\n",
      "$ 买卖标志 <str> '卖出', '卖出', '卖出', '买入', '买入', '买入', '买入', '卖出', '卖出', '卖出'\n",
      "$ 业务名称 <str> '股息入账', '拆出质押购回', '证券卖出', '证券买入', '证券买入', '证券买入', '证券买入', '证券卖出', '证券卖出', '证券卖出'\n",
      "$ 成交时间 <str> '16:00:00', '19:03:27', '09:38:10', '09:44:52', '09:44:31', '09:43:38', '09:42:51', '09:39:28', '09:39:06', '09:38:30'\n",
      "$ 成交数量 <str> '=\"0.00\"', '-580.00', '-10400.00', '47000.00', '11900.00', '40700.00', '30000.00', '-54000.00', '-21400.00', '-38300.00'\n",
      "$ 成交价格 <f64> 3.6, 1.675, 13.2062, 3.19, 12.6066, 3.69, 5.07, 2.5683, 6.5419, 3.58\n",
      "$ 成交金额 <f64> 4884.0, 58000.0, 137344.0, 149930.0, 150019.0, 150183.0, 152100.0, 138686.0, 139996.0, 137114.0\n",
      "$ 发生金额 <f64> 4884.0, 58018.63, 137184.67, -149955.5, -150044.49, -150208.53, -152125.86, 138523.74, 139832.12, 136953.55\n",
      "$ 手续费  <str> '=\"0.00\"', '=\"0.00\"', '21.98', '23.99', '24.00', '24.03', '24.34', '22.19', '22.40', '21.94'\n",
      "$ 印花税  <str> '=\"0.00\"', '=\"0.00\"', '137.35', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '138.69', '140.02', '137.13'\n",
      "$ 过户费  <str> '=\"0.00\"', '=\"0.00\"', '1.38', '1.51', '1.49', '1.50', '1.52', '1.38', '1.46', '1.38'\n",
      "$ 其他费  <str> '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"', '=\"0.00\"'\n",
      "$ 备注   <str> '股息入账:赣粤高速600269; 权益股数:40700;', '融券购回:18.63实际占款天数：7-888880', '证券卖出', '证券买入', '证券买入', '证券买入', '证券买入', '证券卖出', '证券卖出', '证券卖出'\n",
      "$ 币种   <str> '人民币', '人民币', '人民币', '人民币', '人民币', '人民币', '人民币', '人民币', '人民币', '人民币'\n",
      "\n"
     ]
    }
   ],
   "source": [
    "df.glimpse()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "c1f22248-f2c9-4ffc-8702-d968b99b1ed6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (2, 16)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>币种</th></tr><tr><td>i64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>20220721</td><td>&quot;600269&quot;</td><td>&quot;赣粤高速&quot;</td><td>&quot;卖出&quot;</td><td>&quot;股息入账&quot;</td><td>&quot;16:00:00&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>3.6</td><td>4884.0</td><td>4884.0</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;股息入账:赣粤高速600269; 权益股数:40700;&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220718</td><td>&quot;204007&quot;</td><td>&quot;GC007&quot;</td><td>&quot;卖出&quot;</td><td>&quot;拆出质押购回&quot;</td><td>&quot;19:03:27&quot;</td><td>&quot;-580.00&quot;</td><td>1.675</td><td>58000.0</td><td>58018.63</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;融券购回:18.63实际占款天数：7-888880&quot;</td><td>&quot;人民币&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (2, 16)\n",
       "┌─────────┬─────────┬─────────┬────────┬───┬────────┬────────┬────────┬────────┐\n",
       "│ 发生日  ┆ 证券代  ┆ 证券名  ┆ 买卖标 ┆ … ┆ 过户费 ┆ 其他费 ┆ 备注   ┆ 币种   │\n",
       "│ 期      ┆ 码      ┆ 称      ┆ 志     ┆   ┆ ---    ┆ ---    ┆ ---    ┆ ---    │\n",
       "│ ---     ┆ ---     ┆ ---     ┆ ---    ┆   ┆ str    ┆ str    ┆ str    ┆ str    │\n",
       "│ i64     ┆ str     ┆ str     ┆ str    ┆   ┆        ┆        ┆        ┆        │\n",
       "╞═════════╪═════════╪═════════╪════════╪═══╪════════╪════════╪════════╪════════╡\n",
       "│ 2022072 ┆ 600269  ┆ 赣粤高  ┆ 卖出   ┆ … ┆ =\"0.00 ┆ =\"0.00 ┆ 股息入 ┆ 人民币 │\n",
       "│ 1       ┆         ┆ 速      ┆        ┆   ┆ \"      ┆ \"      ┆ 账:赣  ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 粤高速 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 600269 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ ; 权益 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 股数:4 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 0700;  ┆        │\n",
       "│ 2022071 ┆ 204007  ┆ GC007   ┆ 卖出   ┆ … ┆ =\"0.00 ┆ =\"0.00 ┆ 融券购 ┆ 人民币 │\n",
       "│ 8       ┆         ┆         ┆        ┆   ┆ \"      ┆ \"      ┆ 回:18. ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 63实际 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 占款天 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 数：7- ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 888880 ┆        │\n",
       "└─────────┴─────────┴─────────┴────────┴───┴────────┴────────┴────────┴────────┘"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "36af097b-146a-403d-8f95-25e042f1375c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (2, 16)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>币种</th></tr><tr><td>i64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>20220711</td><td>&quot;601077&quot;</td><td>&quot;渝农商行&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:34:24&quot;</td><td>&quot;38300.00&quot;</td><td>3.65</td><td>139795.0</td><td>-139818.75</td><td>&quot;22.37&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;1.38&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220707</td><td>&quot;204007&quot;</td><td>&quot;GC007&quot;</td><td>&quot;卖出&quot;</td><td>&quot;拆出质押购回&quot;</td><td>&quot;19:17:51&quot;</td><td>&quot;-7580.00&quot;</td><td>2.46</td><td>758000.0</td><td>758357.61</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;融券购回:357.61实际占款天数：7-888880&quot;</td><td>&quot;人民币&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (2, 16)\n",
       "┌─────────┬─────────┬─────────┬────────┬───┬────────┬────────┬────────┬────────┐\n",
       "│ 发生日  ┆ 证券代  ┆ 证券名  ┆ 买卖标 ┆ … ┆ 过户费 ┆ 其他费 ┆ 备注   ┆ 币种   │\n",
       "│ 期      ┆ 码      ┆ 称      ┆ 志     ┆   ┆ ---    ┆ ---    ┆ ---    ┆ ---    │\n",
       "│ ---     ┆ ---     ┆ ---     ┆ ---    ┆   ┆ str    ┆ str    ┆ str    ┆ str    │\n",
       "│ i64     ┆ str     ┆ str     ┆ str    ┆   ┆        ┆        ┆        ┆        │\n",
       "╞═════════╪═════════╪═════════╪════════╪═══╪════════╪════════╪════════╪════════╡\n",
       "│ 2022071 ┆ 601077  ┆ 渝农商  ┆ 买入   ┆ … ┆ 1.38   ┆ =\"0.00 ┆ 证券买 ┆ 人民币 │\n",
       "│ 1       ┆         ┆ 行      ┆        ┆   ┆        ┆ \"      ┆ 入     ┆        │\n",
       "│ 2022070 ┆ 204007  ┆ GC007   ┆ 卖出   ┆ … ┆ =\"0.00 ┆ =\"0.00 ┆ 融券购 ┆ 人民币 │\n",
       "│ 7       ┆         ┆         ┆        ┆   ┆ \"      ┆ \"      ┆ 回:357 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ .61实  ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 际占款 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 天数： ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 7-8888 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 80     ┆        │\n",
       "└─────────┴─────────┴─────────┴────────┴───┴────────┴────────┴────────┴────────┘"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.tail(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "19564ad3-5656-4e77-8e00-72e2e2660243",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (5, 16)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>币种</th></tr><tr><td>i64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>20220721</td><td>&quot;600269&quot;</td><td>&quot;赣粤高速&quot;</td><td>&quot;卖出&quot;</td><td>&quot;股息入账&quot;</td><td>&quot;16:00:00&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>3.6</td><td>4884.0</td><td>4884.0</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;股息入账:赣粤高速600269; 权益股数:40700;&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220711</td><td>&quot;=&quot;000900&quot;&quot;</td><td>&quot;现代投资&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:33:37&quot;</td><td>&quot;34400.00&quot;</td><td>4.05</td><td>139320.0</td><td>-139342.29</td><td>&quot;22.29&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;1.39&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220718</td><td>&quot;204007&quot;</td><td>&quot;GC007&quot;</td><td>&quot;卖出&quot;</td><td>&quot;拆出质押购回&quot;</td><td>&quot;19:03:27&quot;</td><td>&quot;-580.00&quot;</td><td>1.675</td><td>58000.0</td><td>58018.63</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;融券购回:18.63实际占款天数：7-888880&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220707</td><td>&quot;204007&quot;</td><td>&quot;GC007&quot;</td><td>&quot;卖出&quot;</td><td>&quot;拆出质押购回&quot;</td><td>&quot;19:17:51&quot;</td><td>&quot;-7580.00&quot;</td><td>2.46</td><td>758000.0</td><td>758357.61</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;融券购回:357.61实际占款天数：7-888880&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>20220711</td><td>&quot;=&quot;002462&quot;&quot;</td><td>&quot;嘉事堂&quot;</td><td>&quot;买入&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;09:38:16&quot;</td><td>&quot;10400.00&quot;</td><td>13.51</td><td>140504.0</td><td>-140526.48</td><td>&quot;22.48&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;1.41&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券买入&quot;</td><td>&quot;人民币&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (5, 16)\n",
       "┌─────────┬─────────┬─────────┬────────┬───┬────────┬────────┬────────┬────────┐\n",
       "│ 发生日  ┆ 证券代  ┆ 证券名  ┆ 买卖标 ┆ … ┆ 过户费 ┆ 其他费 ┆ 备注   ┆ 币种   │\n",
       "│ 期      ┆ 码      ┆ 称      ┆ 志     ┆   ┆ ---    ┆ ---    ┆ ---    ┆ ---    │\n",
       "│ ---     ┆ ---     ┆ ---     ┆ ---    ┆   ┆ str    ┆ str    ┆ str    ┆ str    │\n",
       "│ i64     ┆ str     ┆ str     ┆ str    ┆   ┆        ┆        ┆        ┆        │\n",
       "╞═════════╪═════════╪═════════╪════════╪═══╪════════╪════════╪════════╪════════╡\n",
       "│ 2022072 ┆ 600269  ┆ 赣粤高  ┆ 卖出   ┆ … ┆ =\"0.00 ┆ =\"0.00 ┆ 股息入 ┆ 人民币 │\n",
       "│ 1       ┆         ┆ 速      ┆        ┆   ┆ \"      ┆ \"      ┆ 账:赣  ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 粤高速 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 600269 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ ; 权益 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 股数:4 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 0700;  ┆        │\n",
       "│ 2022071 ┆ =\"00090 ┆ 现代投  ┆ 买入   ┆ … ┆ 1.39   ┆ =\"0.00 ┆ 证券买 ┆ 人民币 │\n",
       "│ 1       ┆ 0\"      ┆ 资      ┆        ┆   ┆        ┆ \"      ┆ 入     ┆        │\n",
       "│ 2022071 ┆ 204007  ┆ GC007   ┆ 卖出   ┆ … ┆ =\"0.00 ┆ =\"0.00 ┆ 融券购 ┆ 人民币 │\n",
       "│ 8       ┆         ┆         ┆        ┆   ┆ \"      ┆ \"      ┆ 回:18. ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 63实际 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 占款天 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 数：7- ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 888880 ┆        │\n",
       "│ 2022070 ┆ 204007  ┆ GC007   ┆ 卖出   ┆ … ┆ =\"0.00 ┆ =\"0.00 ┆ 融券购 ┆ 人民币 │\n",
       "│ 7       ┆         ┆         ┆        ┆   ┆ \"      ┆ \"      ┆ 回:357 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ .61实  ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 际占款 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 天数： ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 7-8888 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 80     ┆        │\n",
       "│ 2022071 ┆ =\"00246 ┆ 嘉事堂  ┆ 买入   ┆ … ┆ 1.41   ┆ =\"0.00 ┆ 证券买 ┆ 人民币 │\n",
       "│ 1       ┆ 2\"      ┆         ┆        ┆   ┆        ┆ \"      ┆ 入     ┆        │\n",
       "└─────────┴─────────┴─────────┴────────┴───┴────────┴────────┴────────┴────────┘"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.sample(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "b4eb69a5-8b3a-48cc-9fd4-b90c415f2c79",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (9, 17)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>statistic</th><th>发生日期</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>币种</th></tr><tr><td>str</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>&quot;count&quot;</td><td>17.0</td><td>&quot;17&quot;</td><td>&quot;17&quot;</td><td>&quot;17&quot;</td><td>&quot;17&quot;</td><td>&quot;17&quot;</td><td>&quot;17&quot;</td><td>17.0</td><td>17.0</td><td>17.0</td><td>&quot;17&quot;</td><td>&quot;17&quot;</td><td>&quot;17&quot;</td><td>&quot;17&quot;</td><td>&quot;17&quot;</td><td>&quot;17&quot;</td></tr><tr><td>&quot;null_count&quot;</td><td>0.0</td><td>&quot;0&quot;</td><td>&quot;0&quot;</td><td>&quot;0&quot;</td><td>&quot;0&quot;</td><td>&quot;0&quot;</td><td>&quot;0&quot;</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;0&quot;</td><td>&quot;0&quot;</td><td>&quot;0&quot;</td><td>&quot;0&quot;</td><td>&quot;0&quot;</td><td>&quot;0&quot;</td></tr><tr><td>&quot;mean&quot;</td><td>2.0221e7</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>5.306059</td><td>160805.352941</td><td>815.642353</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;std&quot;</td><td>4.160387</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>3.974618</td><td>159439.770376</td><td>230047.143813</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;min&quot;</td><td>2.0220707e7</td><td>&quot;204007&quot;</td><td>&quot;GC007&quot;</td><td>&quot;买入&quot;</td><td>&quot;拆出质押购回&quot;</td><td>&quot;09:33:37&quot;</td><td>&quot;-10400.00&quot;</td><td>1.675</td><td>4884.0</td><td>-152125.86</td><td>&quot;2.90&quot;</td><td>&quot;137.13&quot;</td><td>&quot;1.38&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;股息入账:赣粤高速600269; 权益股数:40700;&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>&quot;25%&quot;</td><td>2.0220711e7</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>2.59</td><td>137344.0</td><td>-140526.48</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;50%&quot;</td><td>2.0220718e7</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>3.65</td><td>139860.0</td><td>-139342.29</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;75%&quot;</td><td>2.0220718e7</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>6.54</td><td>149930.0</td><td>136953.55</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td><td>null</td></tr><tr><td>&quot;max&quot;</td><td>2.0220721e7</td><td>&quot;=&quot;002462&quot;&quot;</td><td>&quot;金隅集团&quot;</td><td>&quot;卖出&quot;</td><td>&quot;质押回购拆出&quot;</td><td>&quot;19:17:51&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>13.51</td><td>758000.0</td><td>758357.61</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;=&quot;0.00&quot;&quot;</td><td>&quot;证券卖出&quot;</td><td>&quot;人民币&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (9, 17)\n",
       "┌─────────┬─────────┬─────────┬────────┬───┬────────┬────────┬────────┬────────┐\n",
       "│ statist ┆ 发生日  ┆ 证券代  ┆ 证券名 ┆ … ┆ 过户费 ┆ 其他费 ┆ 备注   ┆ 币种   │\n",
       "│ ic      ┆ 期      ┆ 码      ┆ 称     ┆   ┆ ---    ┆ ---    ┆ ---    ┆ ---    │\n",
       "│ ---     ┆ ---     ┆ ---     ┆ ---    ┆   ┆ str    ┆ str    ┆ str    ┆ str    │\n",
       "│ str     ┆ f64     ┆ str     ┆ str    ┆   ┆        ┆        ┆        ┆        │\n",
       "╞═════════╪═════════╪═════════╪════════╪═══╪════════╪════════╪════════╪════════╡\n",
       "│ count   ┆ 17.0    ┆ 17      ┆ 17     ┆ … ┆ 17     ┆ 17     ┆ 17     ┆ 17     │\n",
       "│ null_co ┆ 0.0     ┆ 0       ┆ 0      ┆ … ┆ 0      ┆ 0      ┆ 0      ┆ 0      │\n",
       "│ unt     ┆         ┆         ┆        ┆   ┆        ┆        ┆        ┆        │\n",
       "│ mean    ┆ 2.0221e ┆ null    ┆ null   ┆ … ┆ null   ┆ null   ┆ null   ┆ null   │\n",
       "│         ┆ 7       ┆         ┆        ┆   ┆        ┆        ┆        ┆        │\n",
       "│ std     ┆ 4.16038 ┆ null    ┆ null   ┆ … ┆ null   ┆ null   ┆ null   ┆ null   │\n",
       "│         ┆ 7       ┆         ┆        ┆   ┆        ┆        ┆        ┆        │\n",
       "│ min     ┆ 2.02207 ┆ 204007  ┆ GC007  ┆ … ┆ 1.38   ┆ =\"0.00 ┆ 股息入 ┆ 人民币 │\n",
       "│         ┆ 07e7    ┆         ┆        ┆   ┆        ┆ \"      ┆ 账:赣  ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 粤高速 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 600269 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ ; 权益 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 股数:4 ┆        │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 0700;  ┆        │\n",
       "│ 25%     ┆ 2.02207 ┆ null    ┆ null   ┆ … ┆ null   ┆ null   ┆ null   ┆ null   │\n",
       "│         ┆ 11e7    ┆         ┆        ┆   ┆        ┆        ┆        ┆        │\n",
       "│ 50%     ┆ 2.02207 ┆ null    ┆ null   ┆ … ┆ null   ┆ null   ┆ null   ┆ null   │\n",
       "│         ┆ 18e7    ┆         ┆        ┆   ┆        ┆        ┆        ┆        │\n",
       "│ 75%     ┆ 2.02207 ┆ null    ┆ null   ┆ … ┆ null   ┆ null   ┆ null   ┆ null   │\n",
       "│         ┆ 18e7    ┆         ┆        ┆   ┆        ┆        ┆        ┆        │\n",
       "│ max     ┆ 2.02207 ┆ =\"00246 ┆ 金隅集 ┆ … ┆ =\"0.00 ┆ =\"0.00 ┆ 证券卖 ┆ 人民币 │\n",
       "│         ┆ 21e7    ┆ 2\"      ┆ 团     ┆   ┆ \"      ┆ \"      ┆ 出     ┆        │\n",
       "└─────────┴─────────┴─────────┴────────┴───┴────────┴────────┴────────┴────────┘"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "8098f2d4-71e7-4e29-b416-5cb953bcc447",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (1, 16)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>币种</th></tr><tr><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td><td>u32</td></tr></thead><tbody><tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (1, 16)\n",
       "┌──────────┬──────────┬──────────┬─────────┬───┬────────┬────────┬──────┬──────┐\n",
       "│ 发生日期 ┆ 证券代码 ┆ 证券名称 ┆ 买卖标  ┆ … ┆ 过户费 ┆ 其他费 ┆ 备注 ┆ 币种 │\n",
       "│ ---      ┆ ---      ┆ ---      ┆ 志      ┆   ┆ ---    ┆ ---    ┆ ---  ┆ ---  │\n",
       "│ u32      ┆ u32      ┆ u32      ┆ ---     ┆   ┆ u32    ┆ u32    ┆ u32  ┆ u32  │\n",
       "│          ┆          ┆          ┆ u32     ┆   ┆        ┆        ┆      ┆      │\n",
       "╞══════════╪══════════╪══════════╪═════════╪═══╪════════╪════════╪══════╪══════╡\n",
       "│ 0        ┆ 0        ┆ 0        ┆ 0       ┆ … ┆ 0      ┆ 0      ┆ 0    ┆ 0    │\n",
       "└──────────┴──────────┴──────────┴─────────┴───┴────────┴────────┴──────┴──────┘"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.null_count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "b84cab72-8074-4810-a58e-406c89e78a68",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>发生日期</th>\n",
       "      <th>证券代码</th>\n",
       "      <th>证券名称</th>\n",
       "      <th>买卖标志</th>\n",
       "      <th>业务名称</th>\n",
       "      <th>成交时间</th>\n",
       "      <th>成交数量</th>\n",
       "      <th>成交价格</th>\n",
       "      <th>成交金额</th>\n",
       "      <th>发生金额</th>\n",
       "      <th>手续费</th>\n",
       "      <th>印花税</th>\n",
       "      <th>过户费</th>\n",
       "      <th>其他费</th>\n",
       "      <th>备注</th>\n",
       "      <th>币种</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>20220721</td>\n",
       "      <td>600269</td>\n",
       "      <td>赣粤高速</td>\n",
       "      <td>卖出</td>\n",
       "      <td>股息入账</td>\n",
       "      <td>16:00:00</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>3.6000</td>\n",
       "      <td>4884.0</td>\n",
       "      <td>4884.00</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>股息入账:赣粤高速600269; 权益股数:40700;</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>20220718</td>\n",
       "      <td>204007</td>\n",
       "      <td>GC007</td>\n",
       "      <td>卖出</td>\n",
       "      <td>拆出质押购回</td>\n",
       "      <td>19:03:27</td>\n",
       "      <td>-580.00</td>\n",
       "      <td>1.6750</td>\n",
       "      <td>58000.0</td>\n",
       "      <td>58018.63</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>融券购回:18.63实际占款天数：7-888880</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>20220718</td>\n",
       "      <td>=\"002462\"</td>\n",
       "      <td>嘉事堂</td>\n",
       "      <td>卖出</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>09:38:10</td>\n",
       "      <td>-10400.00</td>\n",
       "      <td>13.2062</td>\n",
       "      <td>137344.0</td>\n",
       "      <td>137184.67</td>\n",
       "      <td>21.98</td>\n",
       "      <td>137.35</td>\n",
       "      <td>1.38</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>20220718</td>\n",
       "      <td>600408</td>\n",
       "      <td>安泰集团</td>\n",
       "      <td>买入</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>09:44:52</td>\n",
       "      <td>47000.00</td>\n",
       "      <td>3.1900</td>\n",
       "      <td>149930.0</td>\n",
       "      <td>-149955.50</td>\n",
       "      <td>23.99</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>1.51</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>20220718</td>\n",
       "      <td>600648</td>\n",
       "      <td>外高桥</td>\n",
       "      <td>买入</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>09:44:31</td>\n",
       "      <td>11900.00</td>\n",
       "      <td>12.6066</td>\n",
       "      <td>150019.0</td>\n",
       "      <td>-150044.49</td>\n",
       "      <td>24.00</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>1.49</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>20220718</td>\n",
       "      <td>600269</td>\n",
       "      <td>赣粤高速</td>\n",
       "      <td>买入</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>09:43:38</td>\n",
       "      <td>40700.00</td>\n",
       "      <td>3.6900</td>\n",
       "      <td>150183.0</td>\n",
       "      <td>-150208.53</td>\n",
       "      <td>24.03</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>1.50</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>20220718</td>\n",
       "      <td>600015</td>\n",
       "      <td>华夏银行</td>\n",
       "      <td>买入</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>09:42:51</td>\n",
       "      <td>30000.00</td>\n",
       "      <td>5.0700</td>\n",
       "      <td>152100.0</td>\n",
       "      <td>-152125.86</td>\n",
       "      <td>24.34</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>1.52</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>20220718</td>\n",
       "      <td>601992</td>\n",
       "      <td>金隅集团</td>\n",
       "      <td>卖出</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>09:39:28</td>\n",
       "      <td>-54000.00</td>\n",
       "      <td>2.5683</td>\n",
       "      <td>138686.0</td>\n",
       "      <td>138523.74</td>\n",
       "      <td>22.19</td>\n",
       "      <td>138.69</td>\n",
       "      <td>1.38</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>20220718</td>\n",
       "      <td>600894</td>\n",
       "      <td>广日股份</td>\n",
       "      <td>卖出</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>09:39:06</td>\n",
       "      <td>-21400.00</td>\n",
       "      <td>6.5419</td>\n",
       "      <td>139996.0</td>\n",
       "      <td>139832.12</td>\n",
       "      <td>22.40</td>\n",
       "      <td>140.02</td>\n",
       "      <td>1.46</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>20220718</td>\n",
       "      <td>601077</td>\n",
       "      <td>渝农商行</td>\n",
       "      <td>卖出</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>09:38:30</td>\n",
       "      <td>-38300.00</td>\n",
       "      <td>3.5800</td>\n",
       "      <td>137114.0</td>\n",
       "      <td>136953.55</td>\n",
       "      <td>21.94</td>\n",
       "      <td>137.13</td>\n",
       "      <td>1.38</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券卖出</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>20220711</td>\n",
       "      <td>=\"002462\"</td>\n",
       "      <td>嘉事堂</td>\n",
       "      <td>买入</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>09:38:16</td>\n",
       "      <td>10400.00</td>\n",
       "      <td>13.5100</td>\n",
       "      <td>140504.0</td>\n",
       "      <td>-140526.48</td>\n",
       "      <td>22.48</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>1.41</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>20220711</td>\n",
       "      <td>=\"000900\"</td>\n",
       "      <td>现代投资</td>\n",
       "      <td>买入</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>09:33:37</td>\n",
       "      <td>34400.00</td>\n",
       "      <td>4.0500</td>\n",
       "      <td>139320.0</td>\n",
       "      <td>-139342.29</td>\n",
       "      <td>22.29</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>1.39</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>20220711</td>\n",
       "      <td>204007</td>\n",
       "      <td>GC007</td>\n",
       "      <td>卖出</td>\n",
       "      <td>质押回购拆出</td>\n",
       "      <td>09:39:27</td>\n",
       "      <td>580.00</td>\n",
       "      <td>1.6750</td>\n",
       "      <td>58000.0</td>\n",
       "      <td>-58002.90</td>\n",
       "      <td>2.90</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>融券回购购回日:20220718预计利息:18.63参考占款天数：7-888880</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>20220711</td>\n",
       "      <td>601992</td>\n",
       "      <td>金隅集团</td>\n",
       "      <td>买入</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>09:37:25</td>\n",
       "      <td>54000.00</td>\n",
       "      <td>2.5900</td>\n",
       "      <td>139860.0</td>\n",
       "      <td>-139883.80</td>\n",
       "      <td>22.38</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>1.42</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>20220711</td>\n",
       "      <td>600894</td>\n",
       "      <td>广日股份</td>\n",
       "      <td>买入</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>09:36:30</td>\n",
       "      <td>21400.00</td>\n",
       "      <td>6.5400</td>\n",
       "      <td>139956.0</td>\n",
       "      <td>-139979.80</td>\n",
       "      <td>22.39</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>1.41</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>20220711</td>\n",
       "      <td>601077</td>\n",
       "      <td>渝农商行</td>\n",
       "      <td>买入</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>09:34:24</td>\n",
       "      <td>38300.00</td>\n",
       "      <td>3.6500</td>\n",
       "      <td>139795.0</td>\n",
       "      <td>-139818.75</td>\n",
       "      <td>22.37</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>1.38</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>证券买入</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>20220707</td>\n",
       "      <td>204007</td>\n",
       "      <td>GC007</td>\n",
       "      <td>卖出</td>\n",
       "      <td>拆出质押购回</td>\n",
       "      <td>19:17:51</td>\n",
       "      <td>-7580.00</td>\n",
       "      <td>2.4600</td>\n",
       "      <td>758000.0</td>\n",
       "      <td>758357.61</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>=\"0.00\"</td>\n",
       "      <td>融券购回:357.61实际占款天数：7-888880</td>\n",
       "      <td>人民币</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        发生日期       证券代码   证券名称 买卖标志    业务名称      成交时间       成交数量     成交价格  \\\n",
       "0   20220721     600269   赣粤高速   卖出    股息入账  16:00:00    =\"0.00\"   3.6000   \n",
       "1   20220718     204007  GC007   卖出  拆出质押购回  19:03:27    -580.00   1.6750   \n",
       "2   20220718  =\"002462\"    嘉事堂   卖出    证券卖出  09:38:10  -10400.00  13.2062   \n",
       "3   20220718     600408   安泰集团   买入    证券买入  09:44:52   47000.00   3.1900   \n",
       "4   20220718     600648    外高桥   买入    证券买入  09:44:31   11900.00  12.6066   \n",
       "5   20220718     600269   赣粤高速   买入    证券买入  09:43:38   40700.00   3.6900   \n",
       "6   20220718     600015   华夏银行   买入    证券买入  09:42:51   30000.00   5.0700   \n",
       "7   20220718     601992   金隅集团   卖出    证券卖出  09:39:28  -54000.00   2.5683   \n",
       "8   20220718     600894   广日股份   卖出    证券卖出  09:39:06  -21400.00   6.5419   \n",
       "9   20220718     601077   渝农商行   卖出    证券卖出  09:38:30  -38300.00   3.5800   \n",
       "10  20220711  =\"002462\"    嘉事堂   买入    证券买入  09:38:16   10400.00  13.5100   \n",
       "11  20220711  =\"000900\"   现代投资   买入    证券买入  09:33:37   34400.00   4.0500   \n",
       "12  20220711     204007  GC007   卖出  质押回购拆出  09:39:27     580.00   1.6750   \n",
       "13  20220711     601992   金隅集团   买入    证券买入  09:37:25   54000.00   2.5900   \n",
       "14  20220711     600894   广日股份   买入    证券买入  09:36:30   21400.00   6.5400   \n",
       "15  20220711     601077   渝农商行   买入    证券买入  09:34:24   38300.00   3.6500   \n",
       "16  20220707     204007  GC007   卖出  拆出质押购回  19:17:51   -7580.00   2.4600   \n",
       "\n",
       "        成交金额       发生金额      手续费      印花税      过户费      其他费  \\\n",
       "0     4884.0    4884.00  =\"0.00\"  =\"0.00\"  =\"0.00\"  =\"0.00\"   \n",
       "1    58000.0   58018.63  =\"0.00\"  =\"0.00\"  =\"0.00\"  =\"0.00\"   \n",
       "2   137344.0  137184.67    21.98   137.35     1.38  =\"0.00\"   \n",
       "3   149930.0 -149955.50    23.99  =\"0.00\"     1.51  =\"0.00\"   \n",
       "4   150019.0 -150044.49    24.00  =\"0.00\"     1.49  =\"0.00\"   \n",
       "5   150183.0 -150208.53    24.03  =\"0.00\"     1.50  =\"0.00\"   \n",
       "6   152100.0 -152125.86    24.34  =\"0.00\"     1.52  =\"0.00\"   \n",
       "7   138686.0  138523.74    22.19   138.69     1.38  =\"0.00\"   \n",
       "8   139996.0  139832.12    22.40   140.02     1.46  =\"0.00\"   \n",
       "9   137114.0  136953.55    21.94   137.13     1.38  =\"0.00\"   \n",
       "10  140504.0 -140526.48    22.48  =\"0.00\"     1.41  =\"0.00\"   \n",
       "11  139320.0 -139342.29    22.29  =\"0.00\"     1.39  =\"0.00\"   \n",
       "12   58000.0  -58002.90     2.90  =\"0.00\"  =\"0.00\"  =\"0.00\"   \n",
       "13  139860.0 -139883.80    22.38  =\"0.00\"     1.42  =\"0.00\"   \n",
       "14  139956.0 -139979.80    22.39  =\"0.00\"     1.41  =\"0.00\"   \n",
       "15  139795.0 -139818.75    22.37  =\"0.00\"     1.38  =\"0.00\"   \n",
       "16  758000.0  758357.61  =\"0.00\"  =\"0.00\"  =\"0.00\"  =\"0.00\"   \n",
       "\n",
       "                                           备注   币种  \n",
       "0                股息入账:赣粤高速600269; 权益股数:40700;  人民币  \n",
       "1                   融券购回:18.63实际占款天数：7-888880  人民币  \n",
       "2                                        证券卖出  人民币  \n",
       "3                                        证券买入  人民币  \n",
       "4                                        证券买入  人民币  \n",
       "5                                        证券买入  人民币  \n",
       "6                                        证券买入  人民币  \n",
       "7                                        证券卖出  人民币  \n",
       "8                                        证券卖出  人民币  \n",
       "9                                        证券卖出  人民币  \n",
       "10                                       证券买入  人民币  \n",
       "11                                       证券买入  人民币  \n",
       "12  融券回购购回日:20220718预计利息:18.63参考占款天数：7-888880  人民币  \n",
       "13                                       证券买入  人民币  \n",
       "14                                       证券买入  人民币  \n",
       "15                                       证券买入  人民币  \n",
       "16                 融券购回:357.61实际占款天数：7-888880  人民币  "
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.to_pandas()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "2c36176e-3188-4c85-a11b-41f04b4c6a97",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pyarrow.Table\n",
       "发生日期: int64\n",
       "证券代码: large_string\n",
       "证券名称: large_string\n",
       "买卖标志: large_string\n",
       "业务名称: large_string\n",
       "成交时间: large_string\n",
       "成交数量: large_string\n",
       "成交价格: double\n",
       "成交金额: double\n",
       "发生金额: double\n",
       "手续费: large_string\n",
       "印花税: large_string\n",
       "过户费: large_string\n",
       "其他费: large_string\n",
       "备注: large_string\n",
       "币种: large_string\n",
       "----\n",
       "发生日期: [[20220721,20220718,20220718,20220718,20220718,...,20220711,20220711,20220711,20220711,20220707]]\n",
       "证券代码: [[\"600269\",\"204007\",\"=\"002462\"\",\"600408\",\"600648\",...,\"204007\",\"601992\",\"600894\",\"601077\",\"204007\"]]\n",
       "证券名称: [[\"赣粤高速\",\"GC007\",\"嘉事堂\",\"安泰集团\",\"外高桥\",...,\"GC007\",\"金隅集团\",\"广日股份\",\"渝农商行\",\"GC007\"]]\n",
       "买卖标志: [[\"卖出\",\"卖出\",\"卖出\",\"买入\",\"买入\",...,\"卖出\",\"买入\",\"买入\",\"买入\",\"卖出\"]]\n",
       "业务名称: [[\"股息入账\",\"拆出质押购回\",\"证券卖出\",\"证券买入\",\"证券买入\",...,\"质押回购拆出\",\"证券买入\",\"证券买入\",\"证券买入\",\"拆出质押购回\"]]\n",
       "成交时间: [[\"16:00:00\",\"19:03:27\",\"09:38:10\",\"09:44:52\",\"09:44:31\",...,\"09:39:27\",\"09:37:25\",\"09:36:30\",\"09:34:24\",\"19:17:51\"]]\n",
       "成交数量: [[\"=\"0.00\"\",\"-580.00\",\"-10400.00\",\"47000.00\",\"11900.00\",...,\"580.00\",\"54000.00\",\"21400.00\",\"38300.00\",\"-7580.00\"]]\n",
       "成交价格: [[3.6,1.675,13.2062,3.19,12.6066,...,1.675,2.59,6.54,3.65,2.46]]\n",
       "成交金额: [[4884,58000,137344,149930,150019,...,58000,139860,139956,139795,758000]]\n",
       "发生金额: [[4884,58018.63,137184.67,-149955.5,-150044.49,...,-58002.9,-139883.8,-139979.8,-139818.75,758357.61]]\n",
       "..."
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.to_arrow()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "ccf99b6e-dc70-4c7b-bea4-ad959854c489",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'发生日期': 20220721,\n",
       "  '证券代码': '600269',\n",
       "  '证券名称': '赣粤高速',\n",
       "  '买卖标志': '卖出',\n",
       "  '业务名称': '股息入账',\n",
       "  '成交时间': '16:00:00',\n",
       "  '成交数量': '=\"0.00\"',\n",
       "  '成交价格': 3.6,\n",
       "  '成交金额': 4884.0,\n",
       "  '发生金额': 4884.0,\n",
       "  '手续费': '=\"0.00\"',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '=\"0.00\"',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '股息入账:赣粤高速600269; 权益股数:40700;',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220718,\n",
       "  '证券代码': '204007',\n",
       "  '证券名称': 'GC007',\n",
       "  '买卖标志': '卖出',\n",
       "  '业务名称': '拆出质押购回',\n",
       "  '成交时间': '19:03:27',\n",
       "  '成交数量': '-580.00',\n",
       "  '成交价格': 1.675,\n",
       "  '成交金额': 58000.0,\n",
       "  '发生金额': 58018.63,\n",
       "  '手续费': '=\"0.00\"',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '=\"0.00\"',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '融券购回:18.63实际占款天数：7-888880',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220718,\n",
       "  '证券代码': '=\"002462\"',\n",
       "  '证券名称': '嘉事堂',\n",
       "  '买卖标志': '卖出',\n",
       "  '业务名称': '证券卖出',\n",
       "  '成交时间': '09:38:10',\n",
       "  '成交数量': '-10400.00',\n",
       "  '成交价格': 13.2062,\n",
       "  '成交金额': 137344.0,\n",
       "  '发生金额': 137184.67,\n",
       "  '手续费': '21.98',\n",
       "  '印花税': '137.35',\n",
       "  '过户费': '1.38',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券卖出',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220718,\n",
       "  '证券代码': '600408',\n",
       "  '证券名称': '安泰集团',\n",
       "  '买卖标志': '买入',\n",
       "  '业务名称': '证券买入',\n",
       "  '成交时间': '09:44:52',\n",
       "  '成交数量': '47000.00',\n",
       "  '成交价格': 3.19,\n",
       "  '成交金额': 149930.0,\n",
       "  '发生金额': -149955.5,\n",
       "  '手续费': '23.99',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '1.51',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券买入',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220718,\n",
       "  '证券代码': '600648',\n",
       "  '证券名称': '外高桥',\n",
       "  '买卖标志': '买入',\n",
       "  '业务名称': '证券买入',\n",
       "  '成交时间': '09:44:31',\n",
       "  '成交数量': '11900.00',\n",
       "  '成交价格': 12.6066,\n",
       "  '成交金额': 150019.0,\n",
       "  '发生金额': -150044.49,\n",
       "  '手续费': '24.00',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '1.49',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券买入',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220718,\n",
       "  '证券代码': '600269',\n",
       "  '证券名称': '赣粤高速',\n",
       "  '买卖标志': '买入',\n",
       "  '业务名称': '证券买入',\n",
       "  '成交时间': '09:43:38',\n",
       "  '成交数量': '40700.00',\n",
       "  '成交价格': 3.69,\n",
       "  '成交金额': 150183.0,\n",
       "  '发生金额': -150208.53,\n",
       "  '手续费': '24.03',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '1.50',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券买入',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220718,\n",
       "  '证券代码': '600015',\n",
       "  '证券名称': '华夏银行',\n",
       "  '买卖标志': '买入',\n",
       "  '业务名称': '证券买入',\n",
       "  '成交时间': '09:42:51',\n",
       "  '成交数量': '30000.00',\n",
       "  '成交价格': 5.07,\n",
       "  '成交金额': 152100.0,\n",
       "  '发生金额': -152125.86,\n",
       "  '手续费': '24.34',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '1.52',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券买入',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220718,\n",
       "  '证券代码': '601992',\n",
       "  '证券名称': '金隅集团',\n",
       "  '买卖标志': '卖出',\n",
       "  '业务名称': '证券卖出',\n",
       "  '成交时间': '09:39:28',\n",
       "  '成交数量': '-54000.00',\n",
       "  '成交价格': 2.5683,\n",
       "  '成交金额': 138686.0,\n",
       "  '发生金额': 138523.74,\n",
       "  '手续费': '22.19',\n",
       "  '印花税': '138.69',\n",
       "  '过户费': '1.38',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券卖出',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220718,\n",
       "  '证券代码': '600894',\n",
       "  '证券名称': '广日股份',\n",
       "  '买卖标志': '卖出',\n",
       "  '业务名称': '证券卖出',\n",
       "  '成交时间': '09:39:06',\n",
       "  '成交数量': '-21400.00',\n",
       "  '成交价格': 6.5419,\n",
       "  '成交金额': 139996.0,\n",
       "  '发生金额': 139832.12,\n",
       "  '手续费': '22.40',\n",
       "  '印花税': '140.02',\n",
       "  '过户费': '1.46',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券卖出',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220718,\n",
       "  '证券代码': '601077',\n",
       "  '证券名称': '渝农商行',\n",
       "  '买卖标志': '卖出',\n",
       "  '业务名称': '证券卖出',\n",
       "  '成交时间': '09:38:30',\n",
       "  '成交数量': '-38300.00',\n",
       "  '成交价格': 3.58,\n",
       "  '成交金额': 137114.0,\n",
       "  '发生金额': 136953.55,\n",
       "  '手续费': '21.94',\n",
       "  '印花税': '137.13',\n",
       "  '过户费': '1.38',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券卖出',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220711,\n",
       "  '证券代码': '=\"002462\"',\n",
       "  '证券名称': '嘉事堂',\n",
       "  '买卖标志': '买入',\n",
       "  '业务名称': '证券买入',\n",
       "  '成交时间': '09:38:16',\n",
       "  '成交数量': '10400.00',\n",
       "  '成交价格': 13.51,\n",
       "  '成交金额': 140504.0,\n",
       "  '发生金额': -140526.48,\n",
       "  '手续费': '22.48',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '1.41',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券买入',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220711,\n",
       "  '证券代码': '=\"000900\"',\n",
       "  '证券名称': '现代投资',\n",
       "  '买卖标志': '买入',\n",
       "  '业务名称': '证券买入',\n",
       "  '成交时间': '09:33:37',\n",
       "  '成交数量': '34400.00',\n",
       "  '成交价格': 4.05,\n",
       "  '成交金额': 139320.0,\n",
       "  '发生金额': -139342.29,\n",
       "  '手续费': '22.29',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '1.39',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券买入',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220711,\n",
       "  '证券代码': '204007',\n",
       "  '证券名称': 'GC007',\n",
       "  '买卖标志': '卖出',\n",
       "  '业务名称': '质押回购拆出',\n",
       "  '成交时间': '09:39:27',\n",
       "  '成交数量': '580.00',\n",
       "  '成交价格': 1.675,\n",
       "  '成交金额': 58000.0,\n",
       "  '发生金额': -58002.9,\n",
       "  '手续费': '2.90',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '=\"0.00\"',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '融券回购购回日:20220718预计利息:18.63参考占款天数：7-888880',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220711,\n",
       "  '证券代码': '601992',\n",
       "  '证券名称': '金隅集团',\n",
       "  '买卖标志': '买入',\n",
       "  '业务名称': '证券买入',\n",
       "  '成交时间': '09:37:25',\n",
       "  '成交数量': '54000.00',\n",
       "  '成交价格': 2.59,\n",
       "  '成交金额': 139860.0,\n",
       "  '发生金额': -139883.8,\n",
       "  '手续费': '22.38',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '1.42',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券买入',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220711,\n",
       "  '证券代码': '600894',\n",
       "  '证券名称': '广日股份',\n",
       "  '买卖标志': '买入',\n",
       "  '业务名称': '证券买入',\n",
       "  '成交时间': '09:36:30',\n",
       "  '成交数量': '21400.00',\n",
       "  '成交价格': 6.54,\n",
       "  '成交金额': 139956.0,\n",
       "  '发生金额': -139979.8,\n",
       "  '手续费': '22.39',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '1.41',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券买入',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220711,\n",
       "  '证券代码': '601077',\n",
       "  '证券名称': '渝农商行',\n",
       "  '买卖标志': '买入',\n",
       "  '业务名称': '证券买入',\n",
       "  '成交时间': '09:34:24',\n",
       "  '成交数量': '38300.00',\n",
       "  '成交价格': 3.65,\n",
       "  '成交金额': 139795.0,\n",
       "  '发生金额': -139818.75,\n",
       "  '手续费': '22.37',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '1.38',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '证券买入',\n",
       "  '币种': '人民币'},\n",
       " {'发生日期': 20220707,\n",
       "  '证券代码': '204007',\n",
       "  '证券名称': 'GC007',\n",
       "  '买卖标志': '卖出',\n",
       "  '业务名称': '拆出质押购回',\n",
       "  '成交时间': '19:17:51',\n",
       "  '成交数量': '-7580.00',\n",
       "  '成交价格': 2.46,\n",
       "  '成交金额': 758000.0,\n",
       "  '发生金额': 758357.61,\n",
       "  '手续费': '=\"0.00\"',\n",
       "  '印花税': '=\"0.00\"',\n",
       "  '过户费': '=\"0.00\"',\n",
       "  '其他费': '=\"0.00\"',\n",
       "  '备注': '融券购回:357.61实际占款天数：7-888880',\n",
       "  '币种': '人民币'}]"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.to_dicts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "dfbb9b57-47a8-428d-b091-4ae020a66532",
   "metadata": {},
   "outputs": [],
   "source": [
    "s = df.to_series()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "id": "be62d63e-1ece-4c07-bd05-e820c0744a97",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'发生日期'"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.name"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "id": "e46b4efd-1e11-4860-b1fb-4a71341bb911",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Int64"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.dtype"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "b458cfcd-c745-4586-a99d-5dd4cacfb9f7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(17,)"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "id": "0c0f6b98-6418-4802-9562-7a99791a780a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<bound method Series.len of shape: (17,)\n",
       "Series: '发生日期' [i64]\n",
       "[\n",
       "\t20220721\n",
       "\t20220718\n",
       "\t20220718\n",
       "\t20220718\n",
       "\t20220718\n",
       "\t…\n",
       "\t20220711\n",
       "\t20220711\n",
       "\t20220711\n",
       "\t20220711\n",
       "\t20220707\n",
       "]>"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.len"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "e2115d93-6492-418f-b574-86d5029a4199",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (3,)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th></tr><tr><td>i64</td></tr></thead><tbody><tr><td>20220721</td></tr><tr><td>20220718</td></tr><tr><td>20220718</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (3,)\n",
       "Series: '发生日期' [i64]\n",
       "[\n",
       "\t20220721\n",
       "\t20220718\n",
       "\t20220718\n",
       "]"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s[0, 5, 8]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "a7393a04-37f4-4fe7-82bc-e0b05efbafab",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (3,)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th></tr><tr><td>i64</td></tr></thead><tbody><tr><td>20220721</td></tr><tr><td>20220718</td></tr><tr><td>20220718</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (3,)\n",
       "Series: '发生日期' [i64]\n",
       "[\n",
       "\t20220721\n",
       "\t20220718\n",
       "\t20220718\n",
       "]"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s[:3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "id": "7b43e855-9168-48e4-bd7e-2ff6284e0683",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (5, 2)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>印花税</th><th>count</th></tr><tr><td>str</td><td>u32</td></tr></thead><tbody><tr><td>&quot;140.02&quot;</td><td>1</td></tr><tr><td>&quot;138.69&quot;</td><td>1</td></tr><tr><td>&quot;137.35&quot;</td><td>1</td></tr><tr><td>&quot;137.13&quot;</td><td>1</td></tr><tr><td>&quot;=&quot;0.00&quot;&quot;</td><td>13</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (5, 2)\n",
       "┌─────────┬───────┐\n",
       "│ 印花税  ┆ count │\n",
       "│ ---     ┆ ---   │\n",
       "│ str     ┆ u32   │\n",
       "╞═════════╪═══════╡\n",
       "│ 140.02  ┆ 1     │\n",
       "│ 138.69  ┆ 1     │\n",
       "│ 137.35  ┆ 1     │\n",
       "│ 137.13  ┆ 1     │\n",
       "│ =\"0.00\" ┆ 13    │\n",
       "└─────────┴───────┘"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.to_series(11).value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "id": "ea6baf16-41b2-4502-8be5-481b4ced6fc9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (9, 2)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>statistic</th><th>value</th></tr><tr><td>str</td><td>f64</td></tr></thead><tbody><tr><td>&quot;count&quot;</td><td>17.0</td></tr><tr><td>&quot;null_count&quot;</td><td>0.0</td></tr><tr><td>&quot;mean&quot;</td><td>815.642353</td></tr><tr><td>&quot;std&quot;</td><td>230047.143813</td></tr><tr><td>&quot;min&quot;</td><td>-152125.86</td></tr><tr><td>&quot;25%&quot;</td><td>-140526.48</td></tr><tr><td>&quot;50%&quot;</td><td>-139342.29</td></tr><tr><td>&quot;75%&quot;</td><td>136953.55</td></tr><tr><td>&quot;max&quot;</td><td>758357.61</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (9, 2)\n",
       "┌────────────┬───────────────┐\n",
       "│ statistic  ┆ value         │\n",
       "│ ---        ┆ ---           │\n",
       "│ str        ┆ f64           │\n",
       "╞════════════╪═══════════════╡\n",
       "│ count      ┆ 17.0          │\n",
       "│ null_count ┆ 0.0           │\n",
       "│ mean       ┆ 815.642353    │\n",
       "│ std        ┆ 230047.143813 │\n",
       "│ min        ┆ -152125.86    │\n",
       "│ 25%        ┆ -140526.48    │\n",
       "│ 50%        ┆ -139342.29    │\n",
       "│ 75%        ┆ 136953.55     │\n",
       "│ max        ┆ 758357.61     │\n",
       "└────────────┴───────────────┘"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[:, \"发生金额\"].describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "id": "0fc9d6fb-b72e-409c-aa7b-29d900084ff1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[4884.0,\n",
       " 58018.63,\n",
       " 137184.67,\n",
       " -149955.5,\n",
       " -150044.49,\n",
       " -150208.53,\n",
       " -152125.86,\n",
       " 138523.74,\n",
       " 139832.12,\n",
       " 136953.55,\n",
       " -140526.48,\n",
       " -139342.29,\n",
       " -58002.9,\n",
       " -139883.8,\n",
       " -139979.8,\n",
       " -139818.75,\n",
       " 758357.61]"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[:, \"发生金额\"].to_list()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "id": "10c795d2-ee26-479b-a72c-c7fe807f260c",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 117,
   "id": "40b3ade9-6649-4a12-8f2d-7e9061c9116f",
   "metadata": {},
   "outputs": [],
   "source": [
    "def read_df_湘财(f: str | Path) -> pl.DataFrame:\n",
    "    df = pl.read_csv(\n",
    "        f,\n",
    "        encoding=\"gb18030\",\n",
    "        separator=\"\\t\",\n",
    "        infer_schema=False,\n",
    "    )\n",
    "    df = df.with_columns(\n",
    "        pl.selectors.all().str.strip_prefix(\"=\").str.strip_chars('\"'),\n",
    "    )\n",
    "    df = df.with_columns(\n",
    "        pl.col(\"发生日期\").str.to_date(\"%Y%m%d\"),\n",
    "        pl.col(\"证券代码\").str.strip_prefix(\"=\").str.strip_chars('\"'),\n",
    "        pl.col(\"成交时间\").str.to_time(),\n",
    "        pl.col(\n",
    "            \"成交数量\",\n",
    "            \"成交价格\",\n",
    "            \"成交金额\",\n",
    "            \"发生金额\",\n",
    "            \"手续费\",\n",
    "            \"印花税\",\n",
    "            \"过户费\",\n",
    "            \"其他费\",\n",
    "        ).cast(pl.Float64),\n",
    "    )\n",
    "    df = df.filter(\n",
    "        pl.col(\"业务名称\").is_in([\"证券卖出\", \"证券买入\"]),\n",
    "    )\n",
    "    return df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 118,
   "id": "2004ed78-830e-4d75-a4e9-237f4fbaf3fa",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pathlib import Path"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "id": "526f542d-2f44-4ec2-9134-aed3dc631264",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = [read_df_湘财(f) for f in Path(\"stock_trades/\").glob(\"*-湘财.xls\")]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 124,
   "id": "76643c80-fa47-486c-8abc-eee265272154",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (2, 16)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>发生日期</th><th>证券代码</th><th>证券名称</th><th>买卖标志</th><th>业务名称</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>币种</th></tr><tr><td>date</td><td>str</td><td>str</td><td>str</td><td>str</td><td>time</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>2022-09-01</td><td>&quot;603878&quot;</td><td>&quot;武进不锈&quot;</td><td>&quot;卖出&quot;</td><td>&quot;证券卖出&quot;</td><td>09:41:06</td><td>-12200.0</td><td>8.963</td><td>109348.0</td><td>109220.05</td><td>17.5</td><td>109.35</td><td>1.1</td><td>0.0</td><td>&quot;证券卖出&quot;</td><td>&quot;人民币&quot;</td></tr><tr><td>2022-09-01</td><td>&quot;603878&quot;</td><td>&quot;武进不锈&quot;</td><td>&quot;卖出&quot;</td><td>&quot;证券卖出&quot;</td><td>09:40:01</td><td>-4700.0</td><td>9.0736</td><td>42646.0</td><td>42596.09</td><td>6.82</td><td>42.64</td><td>0.45</td><td>0.0</td><td>&quot;证券卖出&quot;</td><td>&quot;人民币&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (2, 16)\n",
       "┌─────────┬─────────┬─────────┬────────┬───┬────────┬────────┬────────┬────────┐\n",
       "│ 发生日  ┆ 证券代  ┆ 证券名  ┆ 买卖标 ┆ … ┆ 过户费 ┆ 其他费 ┆ 备注   ┆ 币种   │\n",
       "│ 期      ┆ 码      ┆ 称      ┆ 志     ┆   ┆ ---    ┆ ---    ┆ ---    ┆ ---    │\n",
       "│ ---     ┆ ---     ┆ ---     ┆ ---    ┆   ┆ f64    ┆ f64    ┆ str    ┆ str    │\n",
       "│ date    ┆ str     ┆ str     ┆ str    ┆   ┆        ┆        ┆        ┆        │\n",
       "╞═════════╪═════════╪═════════╪════════╪═══╪════════╪════════╪════════╪════════╡\n",
       "│ 2022-09 ┆ 603878  ┆ 武进不  ┆ 卖出   ┆ … ┆ 1.1    ┆ 0.0    ┆ 证券卖 ┆ 人民币 │\n",
       "│ -01     ┆         ┆ 锈      ┆        ┆   ┆        ┆        ┆ 出     ┆        │\n",
       "│ 2022-09 ┆ 603878  ┆ 武进不  ┆ 卖出   ┆ … ┆ 0.45   ┆ 0.0    ┆ 证券卖 ┆ 人民币 │\n",
       "│ -01     ┆         ┆ 锈      ┆        ┆   ┆        ┆        ┆ 出     ┆        │\n",
       "└─────────┴─────────┴─────────┴────────┴───┴────────┴────────┴────────┴────────┘"
      ]
     },
     "execution_count": 124,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 127,
   "id": "05a362ac-1c26-40a6-8909-9a57e7cade3a",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1 = pl.concat(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 129,
   "id": "4c63b908-f927-4f17-a563-5150e676356b",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1 = d1.with_columns(\n",
    "    券商=pl.lit(\"湘财\"),\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 209,
   "id": "989f551e-04b1-41f2-bd54-50c6a589b141",
   "metadata": {},
   "outputs": [],
   "source": [
    "def read_df_海通普通(f: str | Path) -> pl.DataFrame:\n",
    "    df = pl.read_excel(\n",
    "        f,\n",
    "        schema_overrides={\n",
    "            \"成交日期\": pl.String,\n",
    "            \"成交时间\": pl.String,\n",
    "        },\n",
    "    )\n",
    "    df = df.filter(\n",
    "        (pl.col(\"成交时间\") != \"\")\n",
    "        & (pl.col(\"操作\").is_in([\"买\", \"卖\"]))\n",
    "        & (~pl.col(\"证券代码\").str.starts_with(\"204\"))\n",
    "        & (~pl.col(\"证券代码\").str.starts_with(\"1318\"))\n",
    "    ).with_columns(\n",
    "        pl.col(\"成交日期\").str.to_date(\"%Y%m%d\"),\n",
    "        pl.col(\"成交时间\").replace({\"\": None}).str.to_time(\"%H:%M:%S\"),\n",
    "        pl.col(\n",
    "            \"成交数量\",\n",
    "            \"成交价格\",\n",
    "            \"成交金额\",\n",
    "            \"发生金额\",\n",
    "            \"手续费\",\n",
    "            \"印花税\",\n",
    "            \"过户费\",\n",
    "            \"其他费\",\n",
    "        ).cast(pl.Float64),\n",
    "    )\n",
    "    return df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 211,
   "id": "aef0ff71-1237-4a3d-aea0-e75a7f11902a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (53, 15)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>证券代码</th><th>证券名称</th><th>成交日期</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>操作</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>券商</th></tr><tr><td>str</td><td>str</td><td>date</td><td>time</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>&quot;002224&quot;</td><td>&quot;三 力 士&quot;</td><td>2023-05-23</td><td>09:58:07</td><td>10800.0</td><td>4.59</td><td>49572.0</td><td>-49576.96</td><td>&quot;买&quot;</td><td>4.96</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;三 力 士证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;300107&quot;</td><td>&quot;建新股份&quot;</td><td>2023-05-23</td><td>10:01:57</td><td>10000.0</td><td>5.0</td><td>50000.0</td><td>-50005.0</td><td>&quot;买&quot;</td><td>5.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;建新股份证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;603002&quot;</td><td>&quot;宏昌电子&quot;</td><td>2023-05-24</td><td>09:54:48</td><td>9800.0</td><td>5.06</td><td>49588.0</td><td>-49593.46</td><td>&quot;买&quot;</td><td>4.96</td><td>0.0</td><td>0.5</td><td>0.0</td><td>&quot;宏昌电子证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;600178&quot;</td><td>&quot;东安动力&quot;</td><td>2023-05-24</td><td>09:59:17</td><td>16400.0</td><td>6.07</td><td>99548.0</td><td>-99558.97</td><td>&quot;买&quot;</td><td>9.95</td><td>0.0</td><td>1.02</td><td>0.0</td><td>&quot;东安动力证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;600626&quot;</td><td>&quot;申达股份&quot;</td><td>2023-05-24</td><td>10:06:14</td><td>14800.0</td><td>3.37</td><td>49876.0</td><td>-49881.48</td><td>&quot;买&quot;</td><td>4.99</td><td>0.0</td><td>0.49</td><td>0.0</td><td>&quot;申达股份证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;603386&quot;</td><td>&quot;骏亚科技&quot;</td><td>2023-07-24</td><td>09:38:22</td><td>4500.0</td><td>11.32</td><td>50940.0</td><td>50883.51</td><td>&quot;卖&quot;</td><td>5.09</td><td>50.91</td><td>0.49</td><td>0.0</td><td>&quot;骏亚科技证券卖出&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;002225&quot;</td><td>&quot;濮耐股份&quot;</td><td>2023-07-24</td><td>09:42:11</td><td>13200.0</td><td>3.8</td><td>50160.0</td><td>-50165.02</td><td>&quot;买&quot;</td><td>5.02</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;濮耐股份证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;600735&quot;</td><td>&quot;新华锦&quot;</td><td>2023-07-24</td><td>09:48:27</td><td>8200.0</td><td>6.07</td><td>49774.0</td><td>-49779.48</td><td>&quot;买&quot;</td><td>4.98</td><td>0.0</td><td>0.5</td><td>0.0</td><td>&quot;新华锦证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;300642&quot;</td><td>&quot;透景生命&quot;</td><td>2023-07-24</td><td>09:49:52</td><td>2500.0</td><td>19.69</td><td>49225.0</td><td>-49229.92</td><td>&quot;买&quot;</td><td>4.92</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;透景生命证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr><tr><td>&quot;000823&quot;</td><td>&quot;超声电子&quot;</td><td>2023-07-24</td><td>09:52:23</td><td>5400.0</td><td>9.38</td><td>50652.0</td><td>-50657.07</td><td>&quot;买&quot;</td><td>5.07</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;超声电子证券买入&quot;</td><td>&quot;海通普通&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (53, 15)\n",
       "┌─────────┬─────────┬─────────┬────────┬───┬────────┬────────┬────────┬────────┐\n",
       "│ 证券代  ┆ 证券名  ┆ 成交日  ┆ 成交时 ┆ … ┆ 过户费 ┆ 其他费 ┆ 备注   ┆ 券商   │\n",
       "│ 码      ┆ 称      ┆ 期      ┆ 间     ┆   ┆ ---    ┆ ---    ┆ ---    ┆ ---    │\n",
       "│ ---     ┆ ---     ┆ ---     ┆ ---    ┆   ┆ f64    ┆ f64    ┆ str    ┆ str    │\n",
       "│ str     ┆ str     ┆ date    ┆ time   ┆   ┆        ┆        ┆        ┆        │\n",
       "╞═════════╪═════════╪═════════╪════════╪═══╪════════╪════════╪════════╪════════╡\n",
       "│ 002224  ┆ 三 力   ┆ 2023-05 ┆ 09:58: ┆ … ┆ 0.0    ┆ 0.0    ┆ 三 力  ┆ 海通普 │\n",
       "│         ┆ 士      ┆ -23     ┆ 07     ┆   ┆        ┆        ┆ 士证券 ┆ 通     │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 买入   ┆        │\n",
       "│ 300107  ┆ 建新股  ┆ 2023-05 ┆ 10:01: ┆ … ┆ 0.0    ┆ 0.0    ┆ 建新股 ┆ 海通普 │\n",
       "│         ┆ 份      ┆ -23     ┆ 57     ┆   ┆        ┆        ┆ 份证券 ┆ 通     │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 买入   ┆        │\n",
       "│ 603002  ┆ 宏昌电  ┆ 2023-05 ┆ 09:54: ┆ … ┆ 0.5    ┆ 0.0    ┆ 宏昌电 ┆ 海通普 │\n",
       "│         ┆ 子      ┆ -24     ┆ 48     ┆   ┆        ┆        ┆ 子证券 ┆ 通     │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 买入   ┆        │\n",
       "│ 600178  ┆ 东安动  ┆ 2023-05 ┆ 09:59: ┆ … ┆ 1.02   ┆ 0.0    ┆ 东安动 ┆ 海通普 │\n",
       "│         ┆ 力      ┆ -24     ┆ 17     ┆   ┆        ┆        ┆ 力证券 ┆ 通     │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 买入   ┆        │\n",
       "│ 600626  ┆ 申达股  ┆ 2023-05 ┆ 10:06: ┆ … ┆ 0.49   ┆ 0.0    ┆ 申达股 ┆ 海通普 │\n",
       "│         ┆ 份      ┆ -24     ┆ 14     ┆   ┆        ┆        ┆ 份证券 ┆ 通     │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 买入   ┆        │\n",
       "│ …       ┆ …       ┆ …       ┆ …      ┆ … ┆ …      ┆ …      ┆ …      ┆ …      │\n",
       "│ 603386  ┆ 骏亚科  ┆ 2023-07 ┆ 09:38: ┆ … ┆ 0.49   ┆ 0.0    ┆ 骏亚科 ┆ 海通普 │\n",
       "│         ┆ 技      ┆ -24     ┆ 22     ┆   ┆        ┆        ┆ 技证券 ┆ 通     │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 卖出   ┆        │\n",
       "│ 002225  ┆ 濮耐股  ┆ 2023-07 ┆ 09:42: ┆ … ┆ 0.0    ┆ 0.0    ┆ 濮耐股 ┆ 海通普 │\n",
       "│         ┆ 份      ┆ -24     ┆ 11     ┆   ┆        ┆        ┆ 份证券 ┆ 通     │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 买入   ┆        │\n",
       "│ 600735  ┆ 新华锦  ┆ 2023-07 ┆ 09:48: ┆ … ┆ 0.5    ┆ 0.0    ┆ 新华锦 ┆ 海通普 │\n",
       "│         ┆         ┆ -24     ┆ 27     ┆   ┆        ┆        ┆ 证券买 ┆ 通     │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 入     ┆        │\n",
       "│ 300642  ┆ 透景生  ┆ 2023-07 ┆ 09:49: ┆ … ┆ 0.0    ┆ 0.0    ┆ 透景生 ┆ 海通普 │\n",
       "│         ┆ 命      ┆ -24     ┆ 52     ┆   ┆        ┆        ┆ 命证券 ┆ 通     │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 买入   ┆        │\n",
       "│ 000823  ┆ 超声电  ┆ 2023-07 ┆ 09:52: ┆ … ┆ 0.0    ┆ 0.0    ┆ 超声电 ┆ 海通普 │\n",
       "│         ┆ 子      ┆ -24     ┆ 23     ┆   ┆        ┆        ┆ 子证券 ┆ 通     │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 买入   ┆        │\n",
       "└─────────┴─────────┴─────────┴────────┴───┴────────┴────────┴────────┴────────┘"
      ]
     },
     "execution_count": 211,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = [read_df_海通普通(p) for p in Path(\"stock_trades/\").glob(\"*-海通普通.xlsx\")]\n",
    "df = pl.concat(df)\n",
    "d2 = df.with_columns(\n",
    "    券商=pl.lit(\"海通普通\"),\n",
    ")\n",
    "d2.sort(\"成交日期\", \"成交时间\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 215,
   "id": "29ec4ed9-810b-4bb2-a602-b67f0566b6aa",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><style>\n",
       ".dataframe > thead > tr,\n",
       ".dataframe > tbody > tr {\n",
       "  text-align: right;\n",
       "  white-space: pre-wrap;\n",
       "}\n",
       "</style>\n",
       "<small>shape: (53, 15)</small><table border=\"1\" class=\"dataframe\"><thead><tr><th>证券代码</th><th>证券名称</th><th>成交日期</th><th>成交时间</th><th>成交数量</th><th>成交价格</th><th>成交金额</th><th>发生金额</th><th>操作</th><th>手续费</th><th>印花税</th><th>过户费</th><th>其他费</th><th>备注</th><th>券商</th></tr><tr><td>str</td><td>str</td><td>date</td><td>time</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>f64</td><td>f64</td><td>f64</td><td>f64</td><td>str</td><td>str</td></tr></thead><tbody><tr><td>&quot;600638&quot;</td><td>&quot;新黄浦&quot;</td><td>2023-07-26</td><td>09:33:56</td><td>9300.0</td><td>6.526</td><td>60696.0</td><td>60628.01</td><td>&quot;卖&quot;</td><td>6.68</td><td>60.7</td><td>0.61</td><td>0.0</td><td>&quot;新黄浦证券卖出&quot;</td><td>&quot;海通两融&quot;</td></tr><tr><td>&quot;002492&quot;</td><td>&quot;恒基达鑫&quot;</td><td>2023-07-27</td><td>09:30:42</td><td>8700.0</td><td>6.12</td><td>53244.0</td><td>53184.91</td><td>&quot;卖&quot;</td><td>5.86</td><td>53.23</td><td>0.0</td><td>0.0</td><td>&quot;恒基达鑫证券卖出&quot;</td><td>&quot;海通两融&quot;</td></tr><tr><td>&quot;002136&quot;</td><td>&quot;安 纳 达&quot;</td><td>2023-07-27</td><td>09:32:52</td><td>4400.0</td><td>11.881</td><td>52277.0</td><td>52218.97</td><td>&quot;卖&quot;</td><td>5.75</td><td>52.28</td><td>0.0</td><td>0.0</td><td>&quot;安 纳 达证券卖出&quot;</td><td>&quot;海通两融&quot;</td></tr><tr><td>&quot;600300&quot;</td><td>&quot;维维股份&quot;</td><td>2023-08-04</td><td>09:36:55</td><td>16400.0</td><td>3.27</td><td>53628.0</td><td>53567.91</td><td>&quot;卖&quot;</td><td>5.9</td><td>53.65</td><td>0.54</td><td>0.0</td><td>&quot;维维股份证券卖出&quot;</td><td>&quot;海通两融&quot;</td></tr><tr><td>&quot;300241&quot;</td><td>&quot;瑞丰光电&quot;</td><td>2023-08-04</td><td>09:39:38</td><td>9700.0</td><td>5.13</td><td>49761.0</td><td>-49766.47</td><td>&quot;买&quot;</td><td>5.47</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;瑞丰光电证券买入&quot;</td><td>&quot;海通两融&quot;</td></tr><tr><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td><td>&hellip;</td></tr><tr><td>&quot;002956&quot;</td><td>&quot;西麦食品&quot;</td><td>2023-10-31</td><td>09:31:53</td><td>5000.0</td><td>14.13</td><td>70650.0</td><td>70607.91</td><td>&quot;卖&quot;</td><td>6.74</td><td>35.35</td><td>0.0</td><td>0.0</td><td>&quot;西麦食品证券卖出&quot;</td><td>&quot;海通两融&quot;</td></tr><tr><td>&quot;603214&quot;</td><td>&quot;爱婴室&quot;</td><td>2023-10-31</td><td>09:39:57</td><td>3100.0</td><td>15.84</td><td>49104.0</td><td>-49109.51</td><td>&quot;买&quot;</td><td>5.0</td><td>0.0</td><td>0.51</td><td>0.0</td><td>&quot;爱婴室证券买入&quot;</td><td>&quot;海通两融&quot;</td></tr><tr><td>&quot;300132&quot;</td><td>&quot;青松股份&quot;</td><td>2023-10-31</td><td>09:40:55</td><td>9600.0</td><td>5.21</td><td>50016.0</td><td>-50021.0</td><td>&quot;买&quot;</td><td>5.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;青松股份证券买入&quot;</td><td>&quot;海通两融&quot;</td></tr><tr><td>&quot;002492&quot;</td><td>&quot;恒基达鑫&quot;</td><td>2023-10-31</td><td>09:43:13</td><td>8400.0</td><td>5.91</td><td>49644.0</td><td>-49649.0</td><td>&quot;买&quot;</td><td>5.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;恒基达鑫证券买入&quot;</td><td>&quot;海通两融&quot;</td></tr><tr><td>&quot;002111&quot;</td><td>&quot;威海广泰&quot;</td><td>2023-10-31</td><td>09:44:45</td><td>5400.0</td><td>9.24</td><td>49896.0</td><td>-49901.0</td><td>&quot;买&quot;</td><td>5.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>&quot;威海广泰证券买入&quot;</td><td>&quot;海通两融&quot;</td></tr></tbody></table></div>"
      ],
      "text/plain": [
       "shape: (53, 15)\n",
       "┌─────────┬─────────┬─────────┬────────┬───┬────────┬────────┬────────┬────────┐\n",
       "│ 证券代  ┆ 证券名  ┆ 成交日  ┆ 成交时 ┆ … ┆ 过户费 ┆ 其他费 ┆ 备注   ┆ 券商   │\n",
       "│ 码      ┆ 称      ┆ 期      ┆ 间     ┆   ┆ ---    ┆ ---    ┆ ---    ┆ ---    │\n",
       "│ ---     ┆ ---     ┆ ---     ┆ ---    ┆   ┆ f64    ┆ f64    ┆ str    ┆ str    │\n",
       "│ str     ┆ str     ┆ date    ┆ time   ┆   ┆        ┆        ┆        ┆        │\n",
       "╞═════════╪═════════╪═════════╪════════╪═══╪════════╪════════╪════════╪════════╡\n",
       "│ 600638  ┆ 新黄浦  ┆ 2023-07 ┆ 09:33: ┆ … ┆ 0.61   ┆ 0.0    ┆ 新黄浦 ┆ 海通两 │\n",
       "│         ┆         ┆ -26     ┆ 56     ┆   ┆        ┆        ┆ 证券卖 ┆ 融     │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 出     ┆        │\n",
       "│ 002492  ┆ 恒基达  ┆ 2023-07 ┆ 09:30: ┆ … ┆ 0.0    ┆ 0.0    ┆ 恒基达 ┆ 海通两 │\n",
       "│         ┆ 鑫      ┆ -27     ┆ 42     ┆   ┆        ┆        ┆ 鑫证券 ┆ 融     │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 卖出   ┆        │\n",
       "│ 002136  ┆ 安 纳   ┆ 2023-07 ┆ 09:32: ┆ … ┆ 0.0    ┆ 0.0    ┆ 安 纳  ┆ 海通两 │\n",
       "│         ┆ 达      ┆ -27     ┆ 52     ┆   ┆        ┆        ┆ 达证券 ┆ 融     │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 卖出   ┆        │\n",
       "│ 600300  ┆ 维维股  ┆ 2023-08 ┆ 09:36: ┆ … ┆ 0.54   ┆ 0.0    ┆ 维维股 ┆ 海通两 │\n",
       "│         ┆ 份      ┆ -04     ┆ 55     ┆   ┆        ┆        ┆ 份证券 ┆ 融     │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 卖出   ┆        │\n",
       "│ 300241  ┆ 瑞丰光  ┆ 2023-08 ┆ 09:39: ┆ … ┆ 0.0    ┆ 0.0    ┆ 瑞丰光 ┆ 海通两 │\n",
       "│         ┆ 电      ┆ -04     ┆ 38     ┆   ┆        ┆        ┆ 电证券 ┆ 融     │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 买入   ┆        │\n",
       "│ …       ┆ …       ┆ …       ┆ …      ┆ … ┆ …      ┆ …      ┆ …      ┆ …      │\n",
       "│ 002956  ┆ 西麦食  ┆ 2023-10 ┆ 09:31: ┆ … ┆ 0.0    ┆ 0.0    ┆ 西麦食 ┆ 海通两 │\n",
       "│         ┆ 品      ┆ -31     ┆ 53     ┆   ┆        ┆        ┆ 品证券 ┆ 融     │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 卖出   ┆        │\n",
       "│ 603214  ┆ 爱婴室  ┆ 2023-10 ┆ 09:39: ┆ … ┆ 0.51   ┆ 0.0    ┆ 爱婴室 ┆ 海通两 │\n",
       "│         ┆         ┆ -31     ┆ 57     ┆   ┆        ┆        ┆ 证券买 ┆ 融     │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 入     ┆        │\n",
       "│ 300132  ┆ 青松股  ┆ 2023-10 ┆ 09:40: ┆ … ┆ 0.0    ┆ 0.0    ┆ 青松股 ┆ 海通两 │\n",
       "│         ┆ 份      ┆ -31     ┆ 55     ┆   ┆        ┆        ┆ 份证券 ┆ 融     │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 买入   ┆        │\n",
       "│ 002492  ┆ 恒基达  ┆ 2023-10 ┆ 09:43: ┆ … ┆ 0.0    ┆ 0.0    ┆ 恒基达 ┆ 海通两 │\n",
       "│         ┆ 鑫      ┆ -31     ┆ 13     ┆   ┆        ┆        ┆ 鑫证券 ┆ 融     │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 买入   ┆        │\n",
       "│ 002111  ┆ 威海广  ┆ 2023-10 ┆ 09:44: ┆ … ┆ 0.0    ┆ 0.0    ┆ 威海广 ┆ 海通两 │\n",
       "│         ┆ 泰      ┆ -31     ┆ 45     ┆   ┆        ┆        ┆ 泰证券 ┆ 融     │\n",
       "│         ┆         ┆         ┆        ┆   ┆        ┆        ┆ 买入   ┆        │\n",
       "└─────────┴─────────┴─────────┴────────┴───┴────────┴────────┴────────┴────────┘"
      ]
     },
     "execution_count": 215,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = [read_df_海通普通(p) for p in Path(\"stock_trades/\").glob(\"*-海通两融.xlsx\")]\n",
    "df = pl.concat(df)\n",
    "d3 = df.with_columns(\n",
    "    券商=pl.lit(\"海通两融\"),\n",
    ")\n",
    "d3.sort(\"成交日期\", \"成交时间\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 218,
   "id": "c9083ed7-61b9-42bc-a760-57d325f04246",
   "metadata": {},
   "outputs": [],
   "source": [
    "d1 = d1.select(\n",
    "    券商=pl.col(\"券商\"),\n",
    "    交易日期=pl.col(\"发生日期\"),\n",
    "    交易时间=pl.col(\"成交时间\"),\n",
    "    证券代码=pl.col(\"证券代码\"),\n",
    "    买卖标志=pl.col(\"业务名称\").replace({\"证券卖出\": \"卖出\", \"证券买入\": \"买入\"}),\n",
    "    成交价格=pl.col(\"成交价格\"),\n",
    "    成交数量=pl.col(\"成交数量\").abs(),\n",
    "    成交金额=pl.col(\"成交金额\"),\n",
    "    手续费=pl.col(\"手续费\"),\n",
    "    印花税=pl.col(\"印花税\"),\n",
    "    过户费=pl.col(\"过户费\"),\n",
    "    其他费=pl.col(\"其他费\"),\n",
    "    发送金额=pl.col(\"发生金额\"),\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 220,
   "id": "6300dfd3-f0fa-452f-b2c2-8eb19cfcbd38",
   "metadata": {},
   "outputs": [],
   "source": [
    "d2 = d2.select(\n",
    "    券商=pl.col(\"券商\"),\n",
    "    交易日期=pl.col(\"成交日期\"),\n",
    "    交易时间=pl.col(\"成交时间\"),\n",
    "    证券代码=pl.col(\"证券代码\"),\n",
    "    买卖标志=pl.col(\"操作\").replace({\"卖\": \"卖出\", \"买\": \"买入\"}),\n",
    "    成交价格=pl.col(\"成交价格\"),\n",
    "    成交数量=pl.col(\"成交数量\").abs(),\n",
    "    成交金额=pl.col(\"成交金额\"),\n",
    "    手续费=pl.col(\"手续费\"),\n",
    "    印花税=pl.col(\"印花税\"),\n",
    "    过户费=pl.col(\"过户费\"),\n",
    "    其他费=pl.col(\"其他费\"),\n",
    "    发送金额=pl.col(\"发生金额\"),\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 221,
   "id": "d435fd82-8c31-4e02-a9f4-452a290e0321",
   "metadata": {},
   "outputs": [],
   "source": [
    "d3 = d3.select(\n",
    "    券商=pl.col(\"券商\"),\n",
    "    交易日期=pl.col(\"成交日期\"),\n",
    "    交易时间=pl.col(\"成交时间\"),\n",
    "    证券代码=pl.col(\"证券代码\"),\n",
    "    买卖标志=pl.col(\"操作\").replace({\"卖\": \"卖出\", \"买\": \"买入\"}),\n",
    "    成交价格=pl.col(\"成交价格\"),\n",
    "    成交数量=pl.col(\"成交数量\").abs(),\n",
    "    成交金额=pl.col(\"成交金额\"),\n",
    "    手续费=pl.col(\"手续费\"),\n",
    "    印花税=pl.col(\"印花税\"),\n",
    "    过户费=pl.col(\"过户费\"),\n",
    "    其他费=pl.col(\"其他费\"),\n",
    "    发送金额=pl.col(\"发生金额\"),\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 226,
   "id": "0d3b1a5b-cff1-4f55-bb0d-892b91f3ccfe",
   "metadata": {},
   "outputs": [],
   "source": [
    " df=pl.concat([d1, d2, d3])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 227,
   "id": "7d6c4d56-85d9-440f-9dff-331fdadf529b",
   "metadata": {},
   "outputs": [],
   "source": [
    "df.write_parquet(\"stock_trades.qarquet\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 228,
   "id": "a01f6cdd-acb7-4ec9-ba0a-5a79eb56b486",
   "metadata": {},
   "outputs": [],
   "source": [
    "df.write_csv(\"stock_trades.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 230,
   "id": "155be4ab-30ce-482c-a834-5a604da6a6b2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<xlsxwriter.workbook.Workbook at 0x241fd598740>"
      ]
     },
     "execution_count": 230,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.write_excel(\"stock_trades.xlsx\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9cd6072b-4381-476a-863b-2bf13af8c5b6",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
